-@page_title = @photo.display_name

- if @related.any?
  -widget do
    %h3=:related_photos_all_members.l
    - @related.each do |photo|
      = link_to image_tag( photo.photo.url(:thumb), :class => "thumbnail"), user_photo_path(photo.user, photo), {:title => :photo_from_user.l_with_args(:photo_description => h(photo.description), :user => photo.user.login)}

- if @is_current_user
  -widget do
    = link_to :make_this_my_profile_photo.l, change_profile_photo_user_path(@user, :photo_id => @photo), :method => :patch

  %p
    = link_to :back.l, user_photos_path(@user), :class => 'btn btn-default'
    = link_to :edit.l, edit_user_photo_path(@user, @photo), :class => 'btn btn-warning'
    = link_to :delete.l, user_photo_path(@user, @photo), :method => :delete, data: { confirm: :are_you_sure.l }, :class => 'btn btn-danger'

= render :partial => 'posts/author_profile', :locals => {:user => @user}

.clearfix
  - if @photo.album
    %h3= "#{:album.l}: #{link_to @photo.album.title, user_album_path(@user, @photo.album)}".html_safe
    .pull-left.col-sm-2
      = link_to "<img src='#{@photo.previous_in_album.photo.url(:thumb)}' class='thumbnail' /><br />&laquo; ".html_safe + :previous.l, user_photo_path(@user, @photo.previous_in_album) if @photo.previous_in_album
    .pull-right.col-sm-2
      = link_to "<img src='#{@photo.next_in_album.photo.url(:thumb)}' class='thumbnail' /><br />".html_safe + :next.l + "&raquo;".html_safe, user_photo_path(@user, @photo.next_in_album) if @photo.next_in_album

  - elsif @previous || @next
    .pull-left.col-sm-2
      = link_to "<img src='#{@previous.photo.url(:thumb)}' class='thumbnail' /><br />&laquo; ".html_safe + :previous.l, user_photo_path(@user, @previous) if @previous
    .pull-right.col-sm-2
      = link_to "<img src='#{@next.photo.url(:thumb)}' class='thumbnail' /><br />".html_safe + :next.l + "&raquo;".html_safe, user_photo_path(@user, @next) if @next

  .col-sm-8
    = image_tag @photo.photo(:large), :class => "thumbnail"
%p= h @photo.description
%p
  - for tag in @photo.tags
    %a.label.label-info{:href => user_photos_path(@photo.user, :tag_name => tag.name)}
      =fa_icon "tag inverse", :text => tag.name

-box :id => 'comments' do
  %h2=:photo_comments.l
  %h3=:add_your_comment.l
  %p= render :partial => 'comments/comment_form', :locals => {:commentable => @photo}
  %a#newest_comment
  = render :partial => 'comments/comment', :collection => @photo.comments
  %span#more_comments_links= more_comments_links(@photo)

